import java.util.ArrayList;
import java.util.Scanner;

public class java1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<>();
        int sum = 0;

        while (sum <= 200) {
            System.out.println("请输入一个1-100之间的整数：");
            int num = scanner.nextInt();

            if (num < 1 || num > 100) {
                System.out.println("请输入有效范围内的整数！");
                continue;
            }

            list.add(num);
            sum += num;
        }

        System.out.println("集合中的元素为：");
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i) + " ");
        }
    }
}